//
//  NSString+HMNSStringExt.m
//  015
//
//  Created by Vitamin on 15/10/8.
//  Copyright (c) 2015年 Vitamin. All rights reserved.
//

#import "NSString+HMNSStringExt.h"

@implementation NSString (HMNSStringExt)

- (CGSize)sizeOfTextWithMaxSize:(CGSize)maxSize font:(UIFont *)font {
    NSDictionary *attrs = @{NSFontAttributeName : font};
    return [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}
+ (CGSize)sizeWithText:(NSString *)text maxSize:(CGSize)maxSize font:(UIFont *)font {
    return [text sizeOfTextWithMaxSize:maxSize font:font];
}
@end
